﻿<%@ page language="java" pageEncoding="UTF-8"%>
<%@include   file="../header.jsp" %>

<link rel="stylesheet" type="text/css" href="${csspath}/style/simplePagination.css">
<script type="text/javascript" src="${jspath}/js/jquery.simplePagination.js"></script>
<script type="text/javascript" src="${jspath}/js/pageview.js"></script>
<script>
    
var totalCount = 0;
var pageNo = 1;

$(document).ready(function(){
	loadRmtpByAjax();
});

function loadRmtpByAjax(){
	jQuery.ajax( {    
	    url:'<%=request.getContextPath()%>/home/rmtp?type=1&counterPerPage=12&offset=' + (pageNo -1) * 12,    
	    type:'post',    
	    cache:false,    
	    dataType:'json',    
	    success:function(data) {    
	       totalCount = data.totalCount;
	       listRmtp(data);
	     },    
	     error : function() {      
	          //alert("请联系系统管理员！");    
	     }    
	}); 
}  

function listRmtp(data){
	var len = data.results.length;
	var results = data.results;
	var html = '<table width="90%" align="center" border="0">';
	for(var idx=0;idx<len;idx++){
		
		if(idx%4 == 0){
			html += '<tr>';
		}
		html += '<td align="center">';
		html += '<div class="home_tp_tab01"><table><tr><td align="center"><a href="#"><img width="150" height="130" src="'+data.drmFilePath + results[idx]._id +  '"/></a></td></tr>';
		html += '<tr><td align="center"><p style="height:10px;">&nbsp;</p>';
		html += '<a href="#">';
		html += '<font size="12px">'+results[idx].title+'</font>';
		html += '</a></td></tr>';
		html += '<tr><td align="center"><font size="12px">点击：'+results[idx].replies+'</font></td></tr></table>';
		html += '</div>';
		html += '<div class="home_tp_tab02"></div>';
		html += '</td>';
		if(idx%4 == 3 || idx == (len -1)){
			html += '</tr><tr><td colspan="4">&nbsp;</td></tr>';
		}
	}
	html += '</table>';
	$("#listRmtp").html(html);
	
	loadPage((pageNo-1)*12);
}

function loadPage(offset){
	createPageDivAjax(totalCount,12,offset,'1');
}


</script>
<div class="home_divtop01"> </div>
<div class=""><a href="http://www.drmaml.com/D2012/merchant/index.html"> <img src="../images/home_images/home_banner01.jpg"> </a></div>

<div class="home_hy_div" >
<p class="retext08">您的位置：首页>家园>热门图片</p>
	<br/>


<div class="home_tp_body">
	<table border='0'>
		<tr>
			<td>
				<div class="home_tp_tab00"></div>
				<div class="home_tp_tab1" id="listRmtp"></div>
			</td>
		</tr>
		
		<tr>
			<td align='left'>

					<script>
						onPageClickFunction =  function(pageNumber, event){			 
								 		var pdata = {};
								 		pdata.type = '';		 	
								    	if(pageNumber){
								    		pdata.pageNo = pageNumber;
								    		pageNo = pageNumber;
								    	}								   		    									    			    	
								    	loadRmtpByAjax();
								      };
					</script>
					<!--页面切换-->	
					<div  id="paging_div" class="tab_page f_array02" style="height:100px;width:500px;"></div>
					<!--end页面切换--> 
			</td>
		</tr>
	</table>
	
</div>

</div>

 <%@include   file="../footer.jsp" %>

</body>
</html>